import os
import sys

domain_map = [
    'Charlie',
    'Ferguson',
    'German',
    'Ottawa',
    'Sydney'
]

py_file = sys.argv[1]
for FS in [20, 40, 60, 80, 100]:
    for domain_id in range(5):
        with open(py_file) as fr:
            with open(f"./CRST_{domain_map[domain_id]}_FS{FS}.py", 'w') as fw:
                codes = fr.read()
                codes = codes.replace("domain_ID = 4", f"domain_ID = {domain_id}")
                codes = codes.replace("few_shot_cnt = 100", f"few_shot_cnt = {FS}")
                fw.write(codes)